package com.guaoran.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * @author : gucheng
 * @Description : <br/>
 * @date :2018/12/4 19:51
 */
@Configuration
@EnableSwagger2
public class SwaggerConfig {
@Bean
public Docket controllerApi() {
    return new Docket(DocumentationType.SWAGGER_2)
            .apiInfo(new ApiInfoBuilder()
                    .title("标题：接口文档")
                    .description("描述：用于管理模块接口...")
                    .contact(new Contact("孤傲然",null,null))
                    .version("版本号:1.0")
                    .build())
            .select()
            .apis(RequestHandlerSelectors.basePackage("com.guaoran.controller"))
            .paths(PathSelectors.any())
            .build();
}
}
